package cn.iocoder.yudao.module.ai.dal.mysql.creationcategory;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.creationcategory.CreationCategoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.creationcategory.vo.*;

/**
 * 创作类别 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CreationCategoryMapper extends BaseMapperX<CreationCategoryDO> {

    default PageResult<CreationCategoryDO> selectPage(CreationCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CreationCategoryDO>()
                .likeIfPresent(CreationCategoryDO::getName, reqVO.getName())
                .eqIfPresent(CreationCategoryDO::getSort, reqVO.getSort())
                .eqIfPresent(CreationCategoryDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(CreationCategoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CreationCategoryDO::getId));
    }

}